package org.dei.perla.rockfall.gui.queryforge.panels;

import java.awt.Dimension;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import org.dei.perla.rockfall.gui.queryforge.IllegaParamValueException;
import org.dei.perla.rockfall.gui.queryforge.ReadableStatusPanel;

public class GainsStatusMemsZPanel extends ReadableStatusPanel {

	private JTextField jText6;
	
	public GainsStatusMemsZPanel(String title) {
		super(title);
	}

	@Override
	public int getStatus() throws IllegaParamValueException {
		int result = Integer.parseInt(jText6.getText());
		if(result > 255)
			throw new IllegaParamValueException("Parametro impostato troppo elevato per memsz (< 255)");
		return result;
	}

	@Override
	public void setStatus(int stato) {
		jText6.setText(Integer.toString(stato));
	}

	@Override
	protected void setupInternalComponents() {
		
				
		jText6 = new JTextField();
		jText6.setColumns(10);
		JLabel jlabel6 = new JLabel("Guadagno mems asse Z");
		JPanel jpanel6 = new JPanel();
		jText6.setText("0");
		BoxLayout layout6 = new BoxLayout(jpanel6, BoxLayout.X_AXIS);
		jpanel6.add(jlabel6);
		jpanel6.add(jText6);		
		
		//aggiungo tutti i blocchi
		this.add(jpanel6);
		
	}

}
